import Taro ,{ Component } from '@tarojs/taro'
import {View, WebView } from '@tarojs/components'

import './commonWebPage.scss'
import DataManager from "../../utils/DataManager";

export default class commonWebPage extends Component{

  config = {
    navigationBarTitleText: ''
  }

  defaultProps = {
    webUrl:'',
    webTitle:''
  }

  constructor() {
    super(...arguments)
  }

  componentWillMount(){
    this.webUrl = this.$router.params.webUrl;
    this.webTitle = this.$router.params.webTitle;

    Taro.setNavigationBarTitle({
      title: this.webTitle
    })

    console.log('webview========== ' + this.webUrl + '    ' + this.webTitle);
  }

  render(){
    return(
      <View className='web-main-container'>
        <WebView src={this.props.webUrl}  />
      </View>
    )
  }
}

